package 练习程序;

public class tast {
    public static void main(String[] args) {
        java.util.Scanner s = new java.util.Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();

        int k = 0;
        for (int i = n; i <= m; i++) {
            boolean a = true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    a = false;
                    break;

                }

            }
            if (a) {
                System.out.print(i + "\t");
                k++;
                if (k == 8) {
                    System.out.println();
                    k = 0;
                }
            }
        }
    }

}


